package bb.lanxing.model.json;

//import com.easemob.chat.core.C2441e;
import com.tencent.open.SocialOperation;
import com.umeng.socialize.net.dplus.CommonNetImpl;
import bb.lanxing.common.config.Constants;
import bb.lanxing.lib.devices.sprint.entity.SettingSupports;
import bb.lanxing.util.JsonUtil;
import bb.lanxing.util.MedalUtil;
import java.io.Serializable;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class RankUser implements Serializable {
    private int age;
    private int gender;
    private int level;
    private String medalSmall;
    private int miles;
    private String name;
    private String photo;
    private int rank;
    private int score;
    private String signature;
    private long uid;
    private List<UserAvatarMedal> userAvatarMedals;

    public RankUser() {
    }

    public RankUser(JSONObject node) throws JSONException {
        JSONArray arrayValue;
        setName(JsonUtil.getStringValue(/*C2441e.f6572j*/"username", node));
        setGender(JsonUtil.getIntegerValue(CommonNetImpl.SEX, node));
        setPhoto(JsonUtil.getStringValue("avatar", node));
        setAge(JsonUtil.getIntegerValue(SettingSupports.SUPPORT_ITEM_AGE, node));
        setUid(JsonUtil.getIntegerValue("userid", node));
        setRank(JsonUtil.getIntegerValue("rank", node));
        setScore(JsonUtil.getIntegerValue("credit", node));
        setMiles(JsonUtil.getIntegerValue("miles", node));
        setSignature(JsonUtil.getStringValue(SocialOperation.GAME_SIGNATURE, node));
        setLevel(JsonUtil.getIntegerValue("ulevel", node));
        if (!node.has("medal_small") || (arrayValue = JsonUtil.getArrayValue("medal_small", node)) == null) {
            return;
        }
        List<UserAvatarMedal> userAvatorMedalInfo = MedalUtil.getUserAvatorMedalInfo(arrayValue);
        if (userAvatorMedalInfo != null) {
            String str = "";
            for (int i = 0; i < userAvatorMedalInfo.size(); i++) {
                str = i == userAvatorMedalInfo.size() - 1 ? str + userAvatorMedalInfo.get(i).getUrl() : str + userAvatorMedalInfo.get(i).getUrl() + ";";
            }
            setMedalSmall(str);
        } else {
            setMedalSmall(null);
        }
        setUserAvatarMedals(userAvatorMedalInfo);
    }

    public List<UserAvatarMedal> getUserAvatarMedals() {
        return this.userAvatarMedals;
    }

    public void setUserAvatarMedals(List<UserAvatarMedal> userAvatarMedals) {
        this.userAvatarMedals = userAvatarMedals;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getLevel() {
        return this.level;
    }

    public void setMedalSmall(String medalSmall) {
        this.medalSmall = medalSmall;
    }

    public String getMedalSmall() {
        return this.medalSmall;
    }

    public String getSignature() {
        return this.signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getUid() {
        return this.uid;
    }

    public void setUid(long uid) {
        this.uid = uid;
    }

    public int getRank() {
        return this.rank;
    }

    public void setRank(int rank) {
        this.rank = rank;
    }

    public int getGender() {
        return this.gender;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    public int getScore() {
        return this.score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public int getMiles() {
        return this.miles;
    }

    public void setMiles(int miles) {
        this.miles = miles;
    }

    public String getPhoto() {
        return this.photo + "!avatar";
    }

    public String getBigPhoto() {
        return this.photo + Constants.UPYUN_IMAGE_TYPE_PHOTO;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public int getAge() {
        return this.age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
